<?php
/**
 * Created By blog_system
 * Author: Virus
 * Date: 2019/9/18
 * Time: 18:57
 */

namespace app\common\validate;


use think\Validate;

class UserValidate extends Validate
{
    protected $rule = [
        'account'    => 'require|unique:user',
        'passwd'     => 'require|min:6',
        'repasswd'   => 'require|confirm:passwd',
        'email'      => 'require|email|unique:user',
        'code|验证码' => 'require|captcha'
    ];

    protected $message = [
        'account.require'   =>  '账号不能为空',
        'account.unique'    =>  '账号已存在',
        'passwd.require'    =>  '密码不能为空',
        'passwd.min'        =>  '密码长度不能少于6位',
        'repasswd.confirm'  =>  '两次密码不相同',
        'email.require'     =>  '邮箱不能为空',
        'email.email'       =>  '邮箱格式不正确',
        'email.unique'      =>  '邮箱已存在',
        'code.require'      =>  '验证码不能为空',
        'code.captcha'      =>  '验证码输入不正确'
    ];
}